﻿using System.Collections.Generic;
using Firefly.Framework.Components;

namespace Firefly.Framework.Collections
{
    public class DrawableEntityDrawOrderComparer : IComparer<IDrawableComponent>
    {
        #region IComparer<T> Members

        public int Compare(IDrawableComponent left, IDrawableComponent right)
        {
            int retval = left.DrawOrder.CompareTo(right.DrawOrder);

            if (retval < 0)
            {
                return -1;
            }
            else
            {
                return (retval > 0) ? 1 : 0;
            }
        }

        #endregion
    }
}
